home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / bin / user-params < prev    next >
Text File  |  2008-04-30  |  2KB  |  98 lines

  1. #!/bin/sh
  2. if [ -z "$TESTSUITE" ]; then
  3.     CMDLINE=/proc/cmdline
  4.     ALIASES=/etc/preseed_aliases
  5. else
  6.     CMDLINE=user-params.in
  7.     ALIASES=user-params.aliases
  8. fi
  9.  
  10. # sed out multi-word quoted value settings
  11. for item in $(sed -e 's/[^ =]*="[^"]*[ ][^"]*"//g' \
  12.           -e "s/[^ =]*='[^']*[ ][^']*'//g" $CMDLINE); do
  13.     var="${item%=*}"
  14.     # Remove trailing '?' for debconf variables set with '?='
  15.     var="${var%\?}"
  16.  
  17.     if [ "$item" = "--" ]; then
  18.         inuser=1
  19.         collect=""
  20.     elif [ "$inuser" ]; then
  21.         # BOOT_IMAGE is added by syslinux
  22.         if [ "$var" = "BOOT_IMAGE" ]; then
  23.             continue
  24.         fi
  25.  
  26.         # init is not generally useful to pass on
  27.         if [ "$var" = init ]; then
  28.             continue
  29.         fi
  30.  
  31.         # suppress installer-specific parameters
  32.         if [ "$var" = BOOT_DEBUG ] || [ "$var" = DEBIAN_FRONTEND ] || \
  33.            [ "$var" = INSTALL_MEDIA_DEV ] || [ "$var" = lowmem ]; then
  34.             continue
  35.         fi
  36.  
  37.         # brltty settings shouldn't be passed since
  38.         # they are already recorded in /etc/brltty.conf
  39.         if [ "$var" = brltty ]; then
  40.             continue
  41.         fi
  42.  
  43.         # ks is only useful to kickseed in the first stage.
  44.         if [ "$var" = ks ]; then
  45.             continue
  46.         fi
  47.  
  48.         # We don't believe that vga= is needed to display a console
  49.         # any more now that we've switched to 640x400 by default,
  50.         # and it breaks suspend/resume. People can always type it in
  51.         # again at the installed boot loader if need be.
  52.         if [ "$var" = vga ]; then
  53.             continue
  54.         fi
  55.  
  56.         # Sometimes used on the live CD for debugging initramfs-tools.
  57.         if [ "$var" = break ]; then
  58.             continue
  59.         fi
  60.  
  61.         # Skip debconf variables
  62.         varnoslash="${var##*/*}"
  63.         if [ "$varnoslash" = "" ]; then
  64.             continue
  65.         fi
  66.  
  67.         # Skip module-specific variables
  68.         varnodot="${var##*.*}"
  69.         if [ "$varnodot" = "" ]; then
  70.             continue
  71.         fi
  72.  
  73.         # Skip preseed aliases
  74.         if [ -e "$ALIASES" ] && \
  75.            grep -q "^$var[[:space:]]" "$ALIASES"; then
  76.             continue
  77.         fi
  78.  
  79.         if [ -z "$collect" ]; then
  80.             collect="$item"
  81.         else
  82.             collect="$collect $item"
  83.         fi
  84.     fi
  85. done
  86.  
  87. if [ -z "$TESTSUITE" ]; then
  88.     # Include default parameters
  89.     RET=`debconf-get debian-installer/add-kernel-opts || true`
  90.     if [ "$RET" ]; then
  91.             collect="$collect $RET"
  92.     fi
  93. fi
  94.  
  95. for word in $collect; do
  96.     echo "$word"
  97. done
  98.